<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta
			http-equiv="origin-trial"
			content="Atzk/dTch1Tt8qYq/UwLn6aWawymlc3xOKy3xiuwsaj1HBK6eCTBb+EGOnv7LK+oSQ8Fr1l/qykGHhK64mAn+w4AAABjeyJvcmlnaW4iOiJodHRwczovL2hwdWdpcy5naXRodWIuaW86NDQzIiwiZmVhdHVyZSI6IldlYkdQVSIsImV4cGlyeSI6MTY5MTcxMTk5OSwiaXNTdWJkb21haW4iOnRydWV9"
		/>
		<title>webworkerTask</title>
		<!-- <link rel="stylesheet" href="./index.scss" /> -->
		<style>
			* {
				box-sizing: border-box;
			}

			html {
				background: #692a84;
				background: linear-gradient(316deg, #0e0f2a, #060913);
				height: 100%;
				width: 100%;
			}

			body {
				font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
				overflow: hidden;
				height: 100%;
				width: 100%;
				margin: 0;
				padding: 0;
			}

			#app {
				height: 100%;
				width: 100%;
			}
		</style>
		<!-- <script type="module" src="../dist/index.js"></script> -->
	</head>

	<body>
		<div id="app"></div>
		<script type="module">
			import {
				BoxGeometry,
				Mesh,
				PerspectiveCamera,
				Scene,
				BlinnPhongMaterial,
				Vector3,
				Color,
				SpotLight,
				PointLight,
				Texture,
				Sampler,
				TorusKnotGeometry,
				PlaneGeometry,
				SkyBox,
				CubeTextureLoader,
				SphereGeometry,
				PbrMaterial,
				loadTexture,
				OrbitControl,
				AmbientLight
			} from "../../dist/index.js";

			const init = async () => {
				const scene = new Scene({
					container: "app"
				});
				const groundGeometry = new PlaneGeometry(100, 100);
				const groundMaterial = new BlinnPhongMaterial();
				groundMaterial.color = new Color(1.0, 0.0, 0.0);
				const ground = new Mesh(groundGeometry, groundMaterial);
				ground.rotateX(Math.PI / 2);
				const camera = new PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.01, 1000);
				camera.position.set(-25, 25, -25);
				camera.lookAt(0, 0, 0);

				const pointLight = new PointLight(new Vector3(1.0, 1.0, 1.0), 1.0, 60, 1.0, false);
				pointLight.position = new Vector3(0, 35, 0);
				scene.add(ground);
				scene.setCamera(camera);
				scene.add(pointLight);
				const control = new OrbitControl(camera, document.getElementById("app"));
				control.zoomSpeed = 2.0;
				control.maxPolarAngle = Math.PI / 2;
				const ambientLight = new AmbientLight(new Vector3(0.25, 0.25, 0.25), 1.0);
				scene.add(ambientLight);
				window.addEventListener("resize", onWindowResize);
				function onWindowResize() {
					camera.aspect = window.innerWidth / window.innerHeight;
					scene.resize(window.innerWidth, window.innerHeight);
				}
				function animate() {
					requestAnimationFrame(animate);
					control.update();
					scene.render();
				}
				animate();
			};
			init();
		</script>
	</body>
</html>
